package com.example.springboot.mqtt.factory;

import com.example.springboot.mqtt.serivice.IMqttService;
import com.example.springboot.mqtt.serivice.impl.HelloMqttServiceImpl;
import com.example.springboot.mqtt.serivice.impl.TestMqttServiceImpl;

public class MqttFactory {
    public static IMqttService getMqttFactory(String topic){
        switch (topic){
            case "mqtt/test":
                return new TestMqttServiceImpl();
            case "mqtt/hello":
                return new HelloMqttServiceImpl();
            default:
                return null;
        }
    }
}
